/*
 * $Id: SimpleLoggerConfigurationProvider.java 74 2013-01-08 14:25:58Z vladimirow@mail.ru $
 * $HeadURL: http://ultralog.googlecode.com/svn/ultralog/trunk/src/java/com/google/code/ultralog/configuration/SimpleLoggerConfigurationProvider.java $
 *
 * This file is a part of ultralog project (http://code.google.com/p/ultralog/).
 * Released under New BSD License.
 */
package com.google.code.ultralog.configuration;

/**
 * Simple implementation of {@link LoggerConfigurationProvider} interface
 * that returns the same configuration for all loggers.
 *
 * @author Mikhail Vladimirov
 */
public class SimpleLoggerConfigurationProvider
    implements LoggerConfigurationProvider
{
    private final LoggerConfiguration loggerConfiguration;

    /**
     * Create new logger configuration provider that returns given logger
     * configuration for all loggers.
     *
     * @param loggerConfiguration logger configuration to return for all loggers
     */
    public SimpleLoggerConfigurationProvider (
        LoggerConfiguration loggerConfiguration)
    {
        if (loggerConfiguration == null)
            throw new IllegalArgumentException ("Logger configuration is null");

        this.loggerConfiguration = loggerConfiguration;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LoggerConfiguration getConfiguration (String loggerName)
    {
        return loggerConfiguration;
    }
}
